package com.arpa.oms.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.arpa.oms.domain.enums.PayableAndReceivableStatusEnum;
import com.arpa.wms.domain.entity.BasicEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * OMS收款单
 * </p>
 *
 * @author LEO
 * @since 2020-11-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="OmsReceivable对象", description="OMS收款单")
public class OmsReceivable extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "收款单号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "收款人标识")
    @TableField("shipment_code")
    private String shipmentCode;

    @ApiModelProperty(value = "收款人名称")
    @TableField("shipment_name")
    private String shipmentName;

    @ApiModelProperty(value = "付款人标识")
    @TableField("customer_code")
    private String customerCode;

    @ApiModelProperty(value = "付款人名称")
    @TableField("customer_name")
    private String customerName;

    @ApiModelProperty(value = "金额")
    @TableField("amount_money")
    private BigDecimal amountMoney;

    @ApiModelProperty(value = "付款金额")
    private String amountCollected;

    @ApiModelProperty(value = "减免金额")
    private BigDecimal amountReduce;

    @ApiModelProperty(value = "状态：NEWS（新增）、PENDING（待审核）、PASS（审核通过）、NO_PASS（审核不通过）")
    @TableField("status")
    private PayableAndReceivableStatusEnum status;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "审核意见")
    @TableField("verify_opinion")
    private String verifyOpinion;

    @ApiModelProperty(value = "审核时间")
    @TableField("gmt_verify")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtVerify;

    @ApiModelProperty(value = "审核人")
    @TableField("verify_by")
    private String verifyBy;

    @ApiModelProperty(value = "审核人姓名")
    @TableField("verify_name")
    private String verifyName;



    @ApiModelProperty(value = "结算明细")
    @TableField(exist = false)
    private List<OmsReceivableItem> omsReceivableItems;


}
